package cn.com.surker.sale.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 销售授信记录表
 * </p>
 *
 * @author admin
 * @since 2024-07-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SaleContractCredit implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 工厂id
     */
    private Long orgId;

    /**
     * 公司名称
     */
    private String orgName;

    /**
     * 销售合同ID
     */
    private Long contractId;

    /**
     * 信控来源类型(0:回款授信，1：退款授信，2：合同评审，3：临供授信)
     */
    private Integer sourceType;

    /**
     * 授信类型(0:金额1:天数)
     */
    private Integer credit;

    /**
     * 授信金额
     */
    private Double money;

    /**
     * 授信天数
     */
    private Integer day;

    /**
     * 生效时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date takeTime;

    /**
     * 状态(0:启用1:禁用)
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 更新人员
     */
    private String updator;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateTime;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    public SaleContractCredit(){}

    public SaleContractCredit(Long orgId, String orgName, Long contractId, Integer sourceType, Integer credit, Double money, Integer day, Date takeTime, Integer status, String remark, String creator, Date createTime) {
        this.orgId = orgId;
        this.orgName = orgName;
        this.contractId = contractId;
        this.sourceType = sourceType;
        this.credit = credit;
        this.money = money;
        this.day = day;
        this.takeTime = takeTime;
        this.status = status;
        this.remark = remark;
        this.creator = creator;
        this.createTime = createTime;
    }

    /**
     * 销售合同名称
     */
    @TableField(exist = false)
    private String contractName;

    /**
     * 合同类型
     */
    @TableField(exist = false)
    private String contractCategory;

    /**
     * 客户姓名
     */
    @TableField(exist = false)
    private String clientName;
}
